<?xml version="1.0" encoding="utf-8" ?>
<taskrunner name="3pp.components" version="1.3" date="2012-03-07" maxthreads="1">

  <!-- 3pp compnents -->
  
  <!--
    Change log:       
      QC9534 : 2011-04-11 : teriks28
        Added task "remove.ewd.readonly.attribute" to remove readonly attribute to resolve a issue that occurs on a reinstall if the first install does not go well.
        If a installation fails after we have copied ewd utillity to the harddrive these folders and files will continue to be readonly. 
        The next installation will not be able to overwrite them and we will get another error and a another failed installation.  
      QC10265 : 2011-08-04 : teriks28
          Removed webex
			CR3812: 2012-02-14: teriks28: 
				Added task for installing new versions of Microsoft.SqlServer dll's in the assambly, to support SQL Server 2008
		CR3904 : 2012-03-07 : teriks28
			Install SQL Express 2008
			Added task for upgrading a SQL Express 2005 to a 2008: "upgrade.sqlexpress2005"			
			Removed tasks : "install.SQLSysClrTypes","install.SharedManagementObjects","install.SQLServer2005XMOx64" since they are not needed for SQLExpress 2008 R2
  -->

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <parameters>
    <parameter name="is.vow" value="INPUT#"/>
    <parameter name="request.sqlexpress" value="true"/>
    <parameter name="request.dice" value="true"/>
    <parameter name="request.adobereader" value="true"/>
    <parameter name="request.isoview" value="true"/>    
    <parameter name="request.x64" value="INPUT#"/>
  </parameters>

  <tasks>

    <task name="is.internet.information.installed" typename="@IsServiceInstalled">
      <description>
        Checks if Internet Information Server is installed
        "true" or "false" will be registered in the global property  - ¤{iis.installed} -
      </description>
      <errormessage>
        An error occurred while checking whether Microsoft Internet Information Server was running or not.
      </errormessage>
      <dependencies list=""/>
      <parameters>
        <parameter name="name" value="World Wide Web Publishing"/>
        <!-- output parameters-->
        <parameter name="return.value" value="iis.installed"/>
      </parameters>
    </task>

    <task name="stop.internet.information.services" condition="¤{iis.installed}=true" typename="@WindowsServiceCommand">
      <description>
        stops internet information service if it's running.
      </description>
      <errormessage>
        An error occurred while stopping the Microsoft Internet Information Server service.
      </errormessage>
      <dependencies list="is.internet.information.installed"/>
      <parameters>
        <parameter name="server.name" value=""/>
        <parameter name="service.name" value="World Wide Web Publishing"/>
        <parameter name="command" value="stop"/>
      </parameters>
    </task>

    <task name="is.sqlexpress.installed" typename="@IsServiceInstalled" condition="${request.sqlexpress}=true">
      <description>
        Checks if preffered Sql Express Instance Service is installed.
        "true" or "false" will be registered in the global property  - ¤{sqlserver.installed} -
      </description>
      <dependencies list="stop.internet.information.services"/>
      <parameters>
        <parameter name="name" value="MSSQL$${sqlserver.instance.name}"/>
        <!-- output parameters-->
        <parameter name="return.value" value="sqlserver.installed"/>
      </parameters>
    </task>   

    <task name="install.sqlexpress" condition="¤{sqlserver.installed}=false AND ${request.sqlexpress}=true">
      <description>
        Installs Sql Server Express
      </description>
      <errormessage>
        An error occurred while installing Microsoft Sql Server Express.
      </errormessage>
      <dependencies list="install.msxml6,is.sqlexpress.installed"/>
      <subtasks filename="vida.install.sqlserver.xml"/>
    </task>

		<task name="upgrade.sqlexpress2005" condition="¤{sqlserver.installed}=true AND ${request.sqlexpress}=true">
			<description>
				Upgrade SQL Express 2005 to Sql Express 2008 R2 Express
			</description>
			<errormessage>
				An error occurred while upgrading Microsoft Sql Express 2005 to Sql Express 2008 R2.
			</errormessage>
			<dependencies list="is.sqlexpress.installed"/>
			<subtasks filename="vida.upgrade.sqlserver.xml"/>
		</task>		
		
    <task name="install.dice" condition="${request.dice}=true">
      <dependencies list="install.sqlexpress[requiresuccess=false]"/>
      <description>
        Install DiCE
      </description>
      <errormessage>
        An error occurred while installing DiCE.
      </errormessage>
      <subtasks filename="vida.install.dice.xml"/>
    </task>

    <task name="install.adobereader" condition="${request.adobereader}=true">
      <dependencies list="install.dice[requiresuccess=false]"/>
      <description>
        Install Adobe Reader 8.0
      </description>
      <errormessage>
        An error occurred while installing Adobe Reader.
      </errormessage>
      <subtasks filename="vida.install.adobereader.xml"/>
    </task>

    <task name="install.isoview" condition="${request.isoview}=true">
      <dependencies list="install.adobereader[requiresuccess=false]"/>
      <description>
        Install IsoView
      </description>
      <errormessage>
        An error occurred while installing Iso View.
      </errormessage>
      <subtasks filename="vida.install.isoview.xml"/>
    </task>

    <task name="copy.ewd.utility" condition="${is.vow}=false" typename="@DirectoryCopy">
      <description>
        EWD utility
      </description>
      <errormessage>
        An error occurred while copying files for EWD utility.
      </errormessage>
      <dependencies list="install.sqlexpress"/>
      <parameters>
        <parameter name="src" value="${install.src.3pp.tools.dir}\ewd"/>
        <parameter name="dst" value="${target.root.utils.dir}\ewd"/>
      </parameters>
    </task>
    
    <!--QC9534-->    
    <task name="remove.ewd.readonly.attribute" critical="false" typename="@CommandLine">
      <description>
        removes the attribute read-only on all files in ${target.root.utils.dir}
      </description>
      <dependencies list="copy.ewd.utility"/>
      <parameters>
        <parameter name="arguments" value="attrib -R /S /D"/>
        <parameter name="workingdirectory" value="${target.root.utils.dir}"/>
        <parameter name="useCmdExe" value="true"/>
      </parameters>
    </task>

  </tasks>
</taskrunner>
